BIN=mytest
SRC=$(shell ls *.c)
OBJ=$(SRC:.c=.o)
cc=gcc 
RM=rm -f
$(BIN):$(OBJ)
	@$(CC) $^ -o $@ -g
	@echo "链接$^成 $@"

%.o:%.c
	@$(CC) -c $^
	@echo "链接$^成 $@" -g

.PHONY:clean
clean:
	$(RM)  *.i *.o *.s mytest


















#mytest:test.o
#	gcc test.o -o mytest
#test.o:test.s
#	gcc -c test.s -o test.o
#test.s:test.i
#	gcc -S test.i -o test.s
#test.i:test.c
#	gcc -E test.c -o test.i
#.PHINY:clean
#clean:
#	rm -f *.i *.s *.o mytest
